home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
pdrd2.zip
/
RD.ZIP
/
API.RD
next >
Wrap
Text File
|
1993-01-11
|
8KB
|
202 lines
/*
API.RD
*/
ADr_version() --> <nVersionNumber>
----------------------------------
Returns version number.
ADr_abort( <nEngine>, [nExitCode] ) --> nil
-------------------------------------------
Aborts the Read. If [nExitCode] is passed, it posts it as the Read exit
code. Otherwise, it posts the default RX_ABORT.
ADr_save( <nEngine>, [nExitCode] ) --> nil
------------------------------------------
Attempts to save the current Get, then exits the Read. If [nExitCode]
is passed, it posts it as the Read exit code. Otherwise, it posts the
default RX_SAVE.
NOTE that if the current value of the current Get is invalid, ADr_save()
will not proceed.
ADr_popup( <nEngine>, <aOptions>, [nRow], [nCol], [aTrigger],;
[lForce] ) --> <nSel>
-------------------------------------------------------------
Pops up a picklist of options for a character Get. Returns a the index
position of the seleccted option, or zero if the picklist was aborted.
Also, if a selection was made, the current Get is automatically updated
with it. When using it as a validation function make sure the return value
of the Valid clause is a logical value.
VALID {|e| ADr_popup( e, aOptions )} // wrong usage
VALID {|e| ADr_popup( e, aOptions ) > 0} // correct usage
[nRow] and [nCol] are the top/left coordinates of the popup box. They
default to the top/left corner of the screen.
[aTrigger] is an aptional array of the index positions of the trigger
keys. Defaults to an array of 1s (the numeric One).
[lForce] is an optional logical value. If it is FALSE, the picklist is
not popped up unless the current entry is invalid. Defaults to FALSE.
The popup is based on the mouseable ADvermenu().
ADr_required( <nEngine>, [bMessage] ) --> <lFilled>
---------------------------------------------------
Typically used in Get validation, it returns a TRUE if the current Get is
not empty. Otherwise, it returns a FALSE and EVALuates [bMessage], passing
to it <nEngine>. [bMessage] defaults to:
{|e| ADmessage( { "May not be left empty" } )}
Note that a Get is "empty" in Clipper-sense, that is:
1. if type == "C" and the value is "" or all spaces, or
2. if type == "N" and the value is 0, or
3. if type == "L" and the value is .F., or
4. if type == "D" and the value is ctod( " / / " )
Obviously, this function may be useful only in "C" and "D" Gets. But then
again, these are the most common Gets you do not want left blank.
ADr_filled( <nEngine>, <aFilled>, [bMessage] ) --> <lFilled>
------------------------------------------------------------
Checks to see if all the Gets whose index positions are included in
<aFilled> are filled. If at least one is empty, it returns a FALSE.
Before returning a FALSE, it EVALuates [bMessage] if it is passed, passing
to it <nEngine>.
ADr_varget( <nEngine>, [nthGet] ) --> <xValue>
----------------------------------------------
Returns the value of the [nthGet] Get. If [nthGet] is not passed, or if
an invalid value is passed, it defaults to the current Get. If [nthGet]
refers to the current Get, the return value is the current contents of the
edit buffer.
ADr_varput( <nEngine>, <xValue>, [nthGet] ) --> nil
---------------------------------------------------
Replaces the value of the [nthGet] Get with <xValue>. If [nthGet] is not
passed, or if an invalid value is passed, it defaults to the current Get.
This function also updates the Get display and sets the o:changed instant
variable to TRUE.
ADr_jump( <nEngine>, <nthGet>, [lRightAway] ) --> <lPossible>
-------------------------------------------------------------
Instructs the engine to jump to the <nthGet> Get and returns a logical
<lPossible>, which is TRUE if it is possible to jump. It would be possible
to jump if both these conditions are TRUE:
a. The <nthGet> Get is focusable in the current context of the Read.
b. <nthGet> is a valid value, that is, it is not less than 1 nor
greater than the number of Gets.
If the jump is possible, it will not be carried out if the current entry
in the current Get is invalid.
Typically, ADr_jump() is called via a Valid clause. In this context, the
jump occurs after validation. In any other context, it is possible to force
the jump to happen right away by passing a TRUE in [lRightAway]. In such
a situation, ADread() first validates the current entry, and proceeds to
jump if it is valid. Note that if a TRUE [lRightAway] is passed in the
context of Valid clause, the validation routine will be called recursively,
causing a "Processor stack fault error". The bottom line is: Do not pass a
TRUE [lRightAway] when calling ADr_jump() within a Valid clause.
ADr_keys( <nEngine>, [aKeys], [bKeysHandler] ) --> nil
------------------------------------------------------
Defines a set of hot keys and a hot key handler.
[aKeys] is an array of the inkey codes of the hot keys to be defined.
[bKeysHandler] is a codeblock that is EVALuated when one of the hot keys
is pressed. Three parameters are passed to the handler:
1 - the numeric engine identifier, <nEngine>
2 - the index position of the pressed hot key.
3 - the inkey value of the pressed hot key.
ADr_lbuttons( <nEngine>, [aSpots], [bLBHandler] ) --> nil
---------------------------------------------------------
Defines a set of left button hot spots and a hot spot handler.
[aSpots] is an array of the coordinates of the hot spots to be defined.
[bLBHandler] is a codeblock that is EVALuated when one of the hot spots
is clicked. Four parameters are passed to the handler:
1 - the numeric engine identifier, <nEngine>
2 - the index position of the clicked hot key.
3 - the mouse cursor row position when the left button was clicked.
4 - the mouse cursor column position when the left button was clicked.
ADr_rbuttons( <nEngine>, [aSpots], [bRBHandler] ) --> nil
---------------------------------------------------------
Defines a set of right button hot spots and a hot spot handler.
[aSpots] is an array of the coordinates of the hot spots to be defined.
[bRBHandler] is a codeblock that is EVALuated when one of the hot spots
is clicked. Four parameters are passed to the handler:
1 - the numeric engine identifier, <nEngine>
2 - the index position of the clicked hot key.
3 - the mouse cursor row position when the right button was clicked.
4 - the mouse cursor column position when the right button was clicked.
ADr_blank( <nEngine>, [xGets] ) --> nil
---------------------------------------
Blanks specific or all Gets. Which Gets will be blanked will depend on the
value of [xGets]:
1. If [xGets] == nil: only the current Get
2. If [xGets] is a numeric: the referenced Get
3. If [xGets] is an empty array: all the Gets
4. If [xGets] is an array of numerics: the Gets pointed to by the
numeric elements
ADr_exit( <nEngine>, <bExit> ) --> nil
--------------------------------------
Assigns an Exit Block to the Read engine. The Exit Block is a codeblock
that is EVALuated just before the Read is exited (NOT aborted). It must
return a logical value. If it EVALuates to a TRUE, the Read proceeds to
exit. The codeblock is automatically passed <nEngine>. Typically, the
Exit Block is used to validate the whole Read.
ADr_nthget( <nEngine> ) --> <nNthGet>
-------------------------------------
Returns the index position of the current Get.
ADr_again( <nEngine> ) --> <nExitCode>
--------------------------------------
Re-activates an exited live Read engine.
ADr_expattr( <nEngine>, [aCoords], [cColor], [cFrame], [cPrompt ) --> nil
-------------------------------------------------------------------------
Changes the default memoedit box coordinates, color, frame and prompt. The
coordinates default to {8,20,16,59}; the color to the current color; and
the frame to "╒═╕│╛═╘│ ".
NOTE: [cPrompt] may be sued to translate the English default,
"Esc:Abort Tab:Save F1:Help", to any language. Note that the
only spaces in the prompt string are the spaces between the options.
No space must be present within an option.